<div class="toolbar">
  <ul class="breadcrumb">
    <li>
      <button class="btn btn-default" name="NewHunt"
              title="New Hunt" ng-click="controller.newHunt()">
        <img src="/static/images/new.png" class="toolbar-icon" />
      </button>

      <div class="btn-group">
        <button class="btn btn-default" name="RunHunt"
                title="Run Hunt"
                ng-disabled="controller.huntsById[selectedHuntId].value.state.value != 'PAUSED' &&
                             controller.huntsById[selectedHuntId].value.state.value != 'STOPPED'"
                ng-click="controller.runHunt()">
          <img src="/static/images/play_button.png" class="toolbar-icon" />
        </button>

        <button class="btn btn-default" name="StopHunt"
                title="Stop Hunt"
                ng-disabled="controller.huntsById[selectedHuntId].value.state.value != 'STARTED'"
                ng-click="controller.stopHunt()">
          <img src="/static/images/stop_button.png" class="toolbar-icon" />
        </button>
      </div>

      <div class="btn-group">
        <button class="btn btn-default" name="ModifyHunt"
                title="Modify Hunt"
                ng-disabled="controller.huntsById[selectedHuntId].value.state.value != 'PAUSED' &&
                             controller.huntsById[selectedHuntId].value.state.value != 'STOPPED'"
                ng-click="controller.modifyHunt()">
          <img src="/static/images/modify.png" class="toolbar-icon" />
        </button>

        <button class="btn btn-default" name="CopyHunt"
                title="Copy Hunt"
                ng-disabled="!selectedHuntId"
                ng-click="controller.copyHunt()">
          <img src="/static/images/copy.png" class="toolbar-icon" />
        </button>

        <button class="btn btn-default" name="DeleteHunt"
                title="Delete Hunt"
                ng-disabled="controller.huntsById[selectedHuntId].value.state.value != 'PAUSED' &&
                             controller.huntsById[selectedHuntId].value.state.value != 'STOPPED'"
                ng-click="controller.deleteHunt()">
          <img src="/static/images/editdelete.png" class="toolbar-icon" />
        </button>
      </div>

      <div class="btn-group">
        <button class="btn btn-default" name="ToggleRobotHuntDisplay"
                title="Show/Hide Automated hunts" uib-btn-checkbox
                ng-model="controller.showRobotHunts">
          <img src="/static/images/robot.png" class="toolbar-icon" />
        </button>
        <a href="/help/investigating-with-grr/hunts/controlling-hunts.html" target="_blank"
          class="pull-right">
          <i class="glyphicon glyphicon-question-sign input-append"></i>
        </a>
      </div>
    </li>
  </ul>
</div>

<div class="fill-parent-with-toolbar">
  <table class="table table-striped table-condensed table-hover table-bordered full-width">
    <colgroup>
      <col />
      <col />
      <col />
      <col />
      <col />
      <col />
      <col />
      <col />
      <col width="100%" />
    </colgroup>
    <thead>
      <tr>
        <th>Status</th>
        <th>Hunt ID</th>
        <th>Creation time</th>
        <th>Start Time</th>
        <th>Duration</th>
        <th>Expiration time</th>
        <th>Client Limit</th>
        <th>Creator</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr grr-infinite-table page-size="100"
          grr-api-items-provider url="controller.huntsUrl"
          transform-items="controller.transformItems(items)" trigger-update="controller.triggerUpdate"
          ng-click="controller.selectItem(item)"
          ng-class="{'row-selected': item.value.hunt_id.value == selectedHuntId, 'warning': item.value.is_robot.value}"
          ng-show="controller.showRobotHunts || !item.value.is_robot.value">

        <td><grr-hunt-status-icon hunt="::item" /></td>
        <td>{$ ::item.value.hunt_id.value $}</td>
        <td><grr-timestamp value="::item.value.created" /></td>
        <td><grr-timestamp value="::item.value.last_start_time" /></td>
        <td><grr-duration value="::item.value.duration" /></td>
        <td><grr-timestamp value="::item.value.expiration_time" /></td>
        <td>{$ ::item.value.client_limit.value $}</td>
        <td>{$ ::item.value.creator.value $}</td>
        <td>{$ ::item.value.description.value $}</td>
      </tr>
    </tbody>
  </table>
</div>
